home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************
- ***** File : CDLOGMenuBar.h *****
- ***** Copyright 1996, Thomas R. Kimpton *****
- ***** All Rights Reserved *****
- ***** *****
- ***** This source code may be freely used in any programming *****
- ***** project so long as credit is duly noted of the author. *****
- ************************************************************************/
- #pragma once
- //************************************************************************
- #pragma mark standard header files
- //************************************************************************
- #include <LPane.h>
-
- //************************************************************************
- #pragma mark local header files
- //************************************************************************
-
- //************************************************************************
- #pragma mark constant definitions
- //************************************************************************
- #define kNumMbarMenus 8 // Max number of menus in dialog menu bar.
- #define kMbarMenusIncr 4 // When we increase the size of the menubar
- // we add this number of menus
-
- const short msg_DLOGMenuBarSelection = 10240;
-
- //************************************************************************
- #pragma mark macro definitions
- //************************************************************************
-
- //************************************************************************
- #pragma mark type definitions
- //************************************************************************
- typedef struct {
- Rect titleRect; /* Portion of the menu bar taken by the title of this menu. */
- MenuHandle theMenu;
- } auxMenuStruct;
-
- //************************************************************************
- #pragma mark class definitions
- //************************************************************************
- class CDLOGMenuBar : public LPane,
- public LBroadcaster {
- public:
- enum { class_ID = 'DLMB' };
- static CDLOGMenuBar* CreatePaneStream(LStream *inStream);
- CDLOGMenuBar();
- CDLOGMenuBar(const CDLOGMenuBar &inOriginal);
- CDLOGMenuBar(LStream *inStream);
- virtual ~CDLOGMenuBar();
-
- virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
- virtual void DrawSelf(void);
- // virtual Boolean HandleKeyPress(const EventRecord &inKeyEvent);
- // virtual void BeTarget();
- virtual long getDlogMenuSelection() { return(mTheSelection); };
- virtual OSErr insertMenuDlogMenuBar(MenuHandle theMenu,short *whichMenuIndex);
- virtual MenuHandle getDlogMenuBarMenu(short whichMenuIndex);
-
- protected:
- static pascal void MenuHookProc(void);
-
- Rect mMBARRect; // Rect, in window, that comprises the menubar.
- long mTheSelection; // The menu/menuItem selected.
- MenuHookUPP mMenuHook; // Pointer to routine used in MenuHook.
- short mCurMaxNumMbarMenus; // Current number of menus possible in menubar.
- short mNumMenus; // Number of menus in this menu bar.
- short mCurMenu; // Index into mMenus for menu currently displayed.
- auxMenuStruct *mMenus; // Holds the handle and titleRect(within the MBAR) for each menu.
- };
-
-
- //************************************************************************
- #pragma mark external variables
- //************************************************************************
-
- //************************************************************************
- #pragma mark external functions
- //************************************************************************
-